package com.bci.pwtz.controller.admin;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bci.pwtz.admin.service.ResourceTypeService;
import com.bci.pwtz.exception.PwtzDatabaseException;
import com.bci.pwtz.mysql.model.ResourceType;


@Controller
@RequestMapping("/restype")
public class ResourceTypeController extends AdminAbstractController{
	@Autowired
private ResourceTypeService service;
	
	@RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
	public List<ResourceType> list(){
		List<ResourceType> list =new ArrayList<ResourceType>();
		try {
			list = service.selectRestypeList();
			setLog(0, "【查询资源类型列表】,【条数】"+list.size(), 0l);
		} catch (PwtzDatabaseException e) {
			e.printStackTrace();
		}
		return list;
	}	
	
	@RequestMapping(value = "/jjfalist", method = RequestMethod.POST)
	@ResponseBody
	public List<ResourceType> jjfalist(){
		List<ResourceType> list =new ArrayList<ResourceType>();
		try {
			list = service.selectjjfa();
			setLog(0, "【查询资源类型(解决方案)列表】,【条数】"+list.size(), 0l);
		} catch (PwtzDatabaseException e) {
			e.printStackTrace();
		}
		return list;
	}	
}
